import { handleActions } from 'redux-actions'

const init = {
  newStaffs: [],
  enrollAnniversary: [],
  notificationList: [],
  sidebars: []
}

export default handleActions({
  'reset home': (state) => ({
    ...state,
    ...init
  }),
  'fetch new staffs': (state, { payload }) => ({
    ...state,
    newStaffs: payload
  }),
  'fetch enroll anniversary': (state, { payload }) => ({
    ...state,
    enrollAnniversary: payload
  }),
  'fetch notification list': (state, { payload }) => ({
    ...state,
    notificationList: payload
  }),
  'fetch sidebar': (state, { payload }) => ({
    ...state,
    sidebars: payload
  })
}, init)
